/*
 * request.h
 *
 *  Created on: 06-06-2012
 *      Author: Mateusz Matrejek
 */

#ifndef REQUEST_H_
#define REQUEST_H_

//server response for login
#define RESP_DEINED -1
#define RESP_ACCEPT 0
#define RESP_SFULL 1

//c-s request types
#define REQ_LOGOUT 1
#define REQ_QUERY 2
#define REQ_RESP 3

#define TYP_OK 1
#define TYP_SENDF 2
#define TYP_RECVF 3
#define TYP_REMVF 4

#include <openssl/md5.h>
#include "backup.h"
#include <time.h>


struct LoginRequest{
  char name[MAX_NAME_LENGTH];
  char passphrase[MAX_NAME_LENGTH];
};

struct LoginResponse{
  int response;
};

struct WorkingRequest{
  char path[MAX_PATH_LENGTH];
  int isDirectory;
  int operation;
  int type;
  time_t mtime;
  off_t size;
  unsigned char hash[MD5_DIGEST_LENGTH];
};

#endif /* REQUEST_H_ */
